package com.ruoyi.web.controller.hotel;


import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.hotel.domain.Room;
import com.ruoyi.hotel.domain.RoomOrder;
import com.ruoyi.hotel.domain.from.RoomFrom;
import com.ruoyi.hotel.domain.from.RoomOrderFrom;
import com.ruoyi.hotel.domain.query.RoomQuery;
import com.ruoyi.hotel.domain.vo.RoomVo;
import com.ruoyi.hotel.service.RoomOrderService;
import com.ruoyi.hotel.service.RoomService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @BelongsProject: ruoyi
 * @BelongsPackage: com.ruoyi.system.controller
 * @Author: lbw
 * @CreateTime: 2025-06-20  11:45
 * @Description: TODO
 */
@RestController
@RequestMapping("/roomOrder")
public class RoomOrderController extends BaseController {

    @Resource
    private RoomOrderService roomOrderService;


    @PostMapping(value = "/save")
    public AjaxResult save(@RequestBody RoomOrderFrom room){
        Boolean save = roomOrderService.saveOrder(room);
        return AjaxResult.success(save);
    }

//    @PostMapping(value = "/update")
//    public AjaxResult update(@RequestBody RoomFrom homeStayFrom){
//        Boolean save = roomOrderService.update(homeStayFrom);
//        return AjaxResult.success(save);
//    }
//
//    @GetMapping(value = "/delete")
//    public AjaxResult delete(Long id){
//        Boolean save = roomOrderService.deleteById(id);
//        return AjaxResult.success(save);
//    }
//
//    /**
//     * 获取用户列表
//     */
////    @PreAuthorize("@ss.hasPermi('system:room:list')")
//    @GetMapping("/list")
//    public TableDataInfo list(Room homeStay)
//    {
//        startPage();
//        List<RoomVo> roomVos = roomOrderService.selectList(homeStay);
//        if(CollUtil.isEmpty(roomVos)){
//            return getDataTable(roomVos);
//        }
//        return getDataTable(roomVos);
//    }
//
//    /**
//     * 获取用户列表
//     */
////    @PreAuthorize("@ss.hasPermi('system:room:list')")
//    @GetMapping("/selectPage")
//    public TableDataInfo selectPage(@RequestBody RoomQuery roomQuery)
//    {
//        IPage<RoomVo> iPage = roomOrderService.selectPage(roomQuery);
//        return getDataTable(iPage.getRecords());
//    } @PostMapping(value = "/update")
//    public AjaxResult update(@RequestBody RoomFrom homeStayFrom){
//        Boolean save = roomOrderService.update(homeStayFrom);
//        return AjaxResult.success(save);
//    }
//
//    @GetMapping(value = "/delete")
//    public AjaxResult delete(Long id){
//        Boolean save = roomOrderService.deleteById(id);
//        return AjaxResult.success(save);
//    }
//
//    /**
//     * 获取用户列表
//     */
////    @PreAuthorize("@ss.hasPermi('system:room:list')")
//    @GetMapping("/list")
//    public TableDataInfo list(Room homeStay)
//    {
//        startPage();
//        List<RoomVo> roomVos = roomOrderService.selectList(homeStay);
//        if(CollUtil.isEmpty(roomVos)){
//            return getDataTable(roomVos);
//        }
//        return getDataTable(roomVos);
//    }
//
//    /**
//     * 获取用户列表
//     */
////    @PreAuthorize("@ss.hasPermi('system:room:list')")
//    @GetMapping("/selectPage")
//    public TableDataInfo selectPage(@RequestBody RoomQuery roomQuery)
//    {
//        IPage<RoomVo> iPage = roomOrderService.selectPage(roomQuery);
//        return getDataTable(iPage.getRecords());
//    }




}